{{ define "content" }}
<article id="{{ .PostDetail.Id }}"
    class="posts-entry fbox post type-post status-publish format-standard hentry category-tech tag-context-in-golang tag-explained tag-golang-context-explained tag-sidetoc">
    <header class="entry-header">
        <h1 class="entry-title">{{ .PostDetail.Title }}</h1>
        <div class="entry-meta">
            <div class="blog-data-wrapper">
                <div class="post-data-divider"></div>
                <div class="post-data-positioning">
                    <div class="post-data-text">
                        <span class="posted-meta-name">最后更新 </span>
                        <span class="posted-meta-value">{{ .PostDetail.UpdatedAt | TimeFormat }}</span>
                        <span class="posted-meta-name">&nbsp;&nbsp;阅读量 </span>
                        <span class="posted-meta-value">{{ .PostDetail.Pv }}</span>
                        {{ if eq .PostDetail.Author $.User.Id }}
                        <a href="/admin/edit/{{ .PostDetail.Id }}">&nbsp;&nbsp;<i class="fa fa-edit"></i></a>
                        <a href="/admin/delete/{{ .PostDetail.Id }}">&nbsp;&nbsp;<i class="fa fa-trash"></i></a>
                        {{ end }}
                    </div>
                </div>
            </div><!-- .entry-meta -->
        </div>
    </header><!-- .entry-header -->
    <div class="markdown-body entry-content">
        {{ .PostDetail.Content | MarkdownHtml }}
        <footer class="reference" style="font-size:11px; color:#cc0000;">
            <strong>（转载本站文章请注明作者和出处：<a href="https://ningto.com">泞途 - ningto.com</a>）</strong>
        </footer>
    </div>
    <div class="entry-content" style="margin: 20px 0px;">
        <p>
            {{ if gt (len .NextPost.Title) 0 }}
            <strong>下一篇</strong>&nbsp;–&nbsp;<a id="goto_next_post"
                href="/post/{{ .NextPost.Id }}">{{ .NextPost.Title }}</a><br>
            {{ end }}
            {{ if gt (len .PrevPost.Title) 0 }}
            <strong>上一篇</strong>&nbsp;– <a id="goto_prev_post" href="/post/{{ .PrevPost.Id }}">{{ .PrevPost.Title }}</a>
            {{ end }}
        </p>
        <ol class="tags-list">
            {{ range .PostDetail.Tags | SplitSemicolon }}
            {{ if . }}<li><a href="/tags/{{ . }}" rel="tag">{{ . }}</a></li>{{ end }}
            {{ end }}
        </ol>
    </div>
    <hr />
  <div id="SOHUCS" sid="{{ .PostDetail.Id }}" ></div> 
</article>
{{ end }}
{{ define "extend_head" }}
<link rel='stylesheet' href='/static/css/ez-toc.css' type='text/css' media='all' />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@10.7.2/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@10.7.2/highlight.min.js"></script>
<script>
    hljs.highlightAll();
    jQuery(document).ready(function () {
        jQuery("#ez-toc-container a.ez-toc-btn").click(function () {
            jQuery("#ez-toc-container nav").toggle("slow");
        })
    });
</script>
{{ end }}
{{ define "extend_script" }}
<script type="text/javascript"> 
(function(){ 
var appid = 'cysWB0Du9'; 
var conf = 'prod_13aa642972f34b70b181f68e5284a610'; 
var width = window.innerWidth || document.documentElement.clientWidth; 
if (width < 1000) {
var head = document.getElementsByTagName('head')[0]||document.head||document.documentElement;
var script = document.createElement('script');
script.type = 'text/javascript';
script.charset = 'utf-8';
script.id = 'changyan_mobile_js';
script.src = 'https://cy-cdn.kuaizhan.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf;
head.appendChild(script);
} else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://cy-cdn.kuaizhan.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } })(); </script>
{{ end }}